import java.io.File;

public class FileMatcher {

    public static void main(String[] args) {
        String directoryPath = "C:\\Users\\minamichiaki\\Desktop\\300英雄全英雄语音立绘"; // 指定目录的路径
        String searchString = "地狱"; // 特定字符

        searchFiles(directoryPath, searchString);
    }

    private static void searchFiles(String directoryPath, String searchString) {
        File directory = new File(directoryPath);
        if (directory.exists() && directory.isDirectory()) {
            File[] files = directory.listFiles();
            if (files != null) {
                for (File file : files) {
                    if (file.isFile()) {
                        String fileName = file.getName();
                        if (fileName.contains(searchString)) {
                            System.out.println("匹配到文件：" + file.getAbsolutePath());
                        }
                    } else if (file.isDirectory()) {
                        searchFiles(file.getAbsolutePath(), searchString);
                    }
                }
            }
        } else {
            System.out.println("指定目录不存在或不是一个目录");
        }
    }

}